package com.grade.system.mapper;

import com.grade.system.entity.Grade;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GradeMapper {

    @Select("select * from grade")
    List<Grade> selGradeByAll();

    @Select("select * from grade where id = #{id}")
    Grade selGradeById(@Param("id") int id);

    @Insert("insert into grade(student_id,course_name,score) values(#{student_id},#{course_name},#{score})")
    boolean insGrade(Grade grade);

    @Update("update grade set student_id = #{student_id},course_name=#{course_name},score=#{score} where id = #{id}")
    boolean updGrade(Grade grade);

    @Delete("delete from grade where id = #{id}")
    boolean delGradeById(@Param("id")int id);

}
